@extends('public.home_base')
@section('title', '重置密码')

@section('content')
    <link rel="stylesheet" href="/static/css/index-style.css">


    <section class="center_container">
        <section class="login_container" style="height:560px;">
            <div class="banner">
                <p>
                    效率成就品牌
                    &emsp;
                    诚信铸就未来
                </p>
            </div>
            <div class="content">
                <form id="reg_form" action="reg" method="post">
                    {{csrf_field()}}
                    <div class="box">
                        <div class="inner_title">
                            <span class="f20 text_orange">重置密码</span>
                        </div>
                        <ul class="reg">
                            {{--                            <li>--}}
                            {{--                                <span class="cl"><i class="text_red">*</i>用户名：</span>--}}
                            {{--                                <div>--}}
                            {{--                                    <input type="text" name="userName" placeholder="请输入用户名">--}}
                            {{--                                </div>--}}
                            {{--                            </li>--}}
                            <li>
                                <span class="cl"><i class="text_red">*</i>邮箱：</span>
                                <div>
                                    <input type="text" name="email" value="{{@$_GET['email']}}" disabled >
                                    <input type="hidden" name="token" value="{{@$_GET['token']}}" disabled >
                                </div>
                            </li>
                            {{--                            <li>--}}
                            {{--                                <span class="cl"><i class="text_red">*</i>手机号：</span>--}}
                            {{--                                <div>--}}
                            {{--                                    <input type="text" name="phone" placeholder="请输入手机号">--}}
                            {{--                                </div>--}}
                            {{--                            </li>--}}
                            {{--                            <li>--}}
                            {{--                                <span class="cl"><i class="text_red">*</i>手机验证：</span>--}}
                            {{--                                <div>--}}
                            {{--                                    <input type="text" name="authCode" placeholder="请输入手机验证码">--}}
                            {{--                                    <input type="button" value="发送验证码" id="sms_send" class="btn btn_primary">--}}
                            {{--                                </div>--}}
                            {{--                            </li>--}}

                            <li>
                                <span class="cl"><i class="text_red">*</i>密码：</span>
                                <div>
                                    <input type="password" name="password" placeholder="请输入密码">
                                </div>
                            </li>
                            <li>
                                <span class="cl"><i class="text_red">*</i>确认密码：</span>
                                <div>
                                    <input type="password" name="password2" placeholder="请输入确认密码">
                                </div>
                            </li>
                            <li>
                                <span class="cl">&nbsp;</span>
                                <div>
                                    <input type="submit" class="btn btn_primary" value="重置密码">
                                    <p class="text_center mt10">已经有账户？<a href="/member/login">立即登录</a></p>
                                </div>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
        </section>
    </section>
@endsection
@section('script')
    <script>
        $(function () {
            $("#reg_form").validate({
                rules: {
                    password: {
                        required: true,
                        minlength:6,

                    },
                    password2: {
                        required: true,
                        minlength:6,
                    },
                },
                onkeyup: false,
                focusCleanup: true,
                success: "valid",
                submitHandler: function (form) {
                    $(form).ajaxSubmit({
                        type: 'post',
                        url: "",
                        success: function (data) {
                            if (data.msg === 'success') {
                                layer.msg('成功!', {icon: 1, time: 1000}, function () {
                                    // parent.window.location = parent.window.location;
                                    //parent.layer.close(index);
                                    window.location='/member/login';
                                })
                            } else {
                                layer.msg(data.data.error, {icon: 2, time: 1000,});
                            }
                        },
                        error: function (XmlHttpRequest, textStatus, errorThrown) {
                            layer.msg(XmlHttpRequest.responseJSON.data, {icon: 2, time: 1000}, function () {

                            });
                        }
                    });
                }
            });
        });
    </script>
@endsection
